package com.cn.studySpring.service.impl;

import com.cn.studySpring.mapper.UserMapper;
import com.cn.studySpring.pojo.User;
import com.cn.studySpring.service.UserService;

import javax.annotation.Resource;
import java.util.List;

public class UserServiceImpl implements UserService {

	@Resource
	UserMapper userMapper;

	@Override
	public User getUserById(String userid) {
		return userMapper.getUserById(userid);
	}

	@Override
	public int updateUser(User user) {
		return userMapper.updateUser(user);
	}

	/**
	 * 注册新的用户
	 *
	 * @param user
	 */
	@Override
	public int addUser(User user) {
		return userMapper.addUser(user);
	}

	@Override
	public List<User> getAllUser() {
		return userMapper.getAllUser();
	}
}
